package org.example.mapper;

import org.apache.ibatis.annotations.Param;
import org.example.pojo.Employee;

import java.util.List;
import java.util.Map;

/**
 * ClassName: EmployeeMapper
 * Package: org.example.mapper
 * Description:
 *
 * @Author 王豪
 * @Create 2024/10/5 10:28
 * @Version 1.0
 */
public interface EmployeeMapper {

    Employee selectEmployee(Integer empId);

    int insertEmployee(Employee employee);

    int deleteEmployee(Integer empId);

    int updateEmployee(Employee employee);

    Employee selectEmployeeByName(@Param("empName") String empName);

    int updateEmpSalaryByEmpId(@Param("empId") Integer empId, @Param("empSalary") Double empSalary);

    int updateEmployeeByMap(Map<String, Object> paramMap);

    int selectEmpCount();

    Map<String, Object> selectEmpNameAndMaxSalary();

    List<Employee> selectAll();

    int insertEmployee2(Employee employee);

    Employee selectEmployeeByRM(Integer empId);

    int updateEmployeeBatch(@Param("empList") List<Employee> empList);

    // 如果没有给接口中List类型的参数使用@Param注解指定一个具体的名字，那么在collection属性中默认可以使用collection或list来引用这个list集合
    int insertEmpList(List<Employee> empList);
}
